package com.dm0858.bianmin.mine.viewmodel;

import androidx.lifecycle.ViewModel;

import com.dm0858.bianmin.mine.listener.IResultListener;
import com.dm0858.bianmin.mine.model.MineModel;
import com.dm0858.bianmin.mine.network.Retrofit;
import com.dm0858.bianmin.mine.network.RetrofitListener;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;

public class LoginViewModel extends ViewModel {

    private Retrofit retrofit;

    public LoginViewModel() {
        if (retrofit == null) retrofit = new Retrofit();
    }

    /**
     *
     * @description 获取验证码
     * @author 迪迪丶Sir
     * @e-mail asd969709719@qq.com
     * @since 2020-05-17
     **/
    public void getCode(String phone, IResultListener listener) {
        MineModel.sendPhoneCode(retrofit,phone,listener);
    }

    /**
     *
     * @description 登录
     * @author 迪迪丶Sir
     * @e-mail asd969709719@qq.com
     * @since 2020-05-17
     **/
    public void login(String phone, String code, RetrofitListener listener) {
        MineModel.login(retrofit, phone, code,listener);
    }



    /**
     *
     * @description 微信登录
     * @author 迪迪丶Sir
     * @e-mail asd969709719@qq.com
     * @since 2020-05-03
     **/
    public void weChatLogin(IWXAPI api) {

    }

}
